package com.diandian.backend.store.param;

import com.diandian.backend.store.dto.JingdongHomeStoreAddParamDTO;
import com.diandian.base.boot.starter.exception.DefaultException;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class JingdongHomeStoreAddParam implements Serializable {

	private String offlineCode;
	private String onlineCode;
	private String onlineName;
	private String stauts;
	private String phone;
	private String city;
	private String country;
	private String addressDetail;
	private String operator;
	private String lat;
	private String lng;
	private String deliveryRangeType;
	private String coordinateType;
	private String standByPhone;
	private String serviceStartTime;
	private String serviceEndTime;
	private String deliveryRangeRadius;
	private String coordinatePoints;
	private String belong;
	private String remark;
	private String orgId;
	private String orgCode;
	private String createUserId;
	private String createUserName;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	private String nodeCode;

	public void check(){
		if(this.offlineCode == null || "".equals(this.offlineCode)){
			throw new DefaultException("线下门店编码不能为空");
		}
		if(this.onlineCode == null || "".equals(this.onlineCode)){
			throw new DefaultException("线上门店编码不能为空");
		}
		if(this.onlineName == null || "".equals(this.onlineName)){
			throw new DefaultException("线上门店名称不能为空");
		}
		if(this.belong == null || "".equals(this.belong)){
			throw new DefaultException("归属不能为空");
		}
		if(this.nodeCode == null || "".equals(this.nodeCode)){
			throw new DefaultException("节点不能为空");
		}
	}

	public JingdongHomeStoreAddParamDTO toDTO(){
		JingdongHomeStoreAddParamDTO dto = new JingdongHomeStoreAddParamDTO();
		dto.setOfflineCode(this.offlineCode);
		dto.setOnlineCode(this.onlineCode);
		dto.setOnlineName(this.onlineName);
		dto.setStauts(this.stauts);
		dto.setPhone(this.phone);
		dto.setCity(this.city);
		dto.setCountry(this.country);
		dto.setAddressDetail(this.addressDetail);
		dto.setOperator(this.operator);
		dto.setLat(this.lat);
		dto.setLng(this.lng);
		dto.setDeliveryRangeType(this.deliveryRangeType);
		dto.setCoordinateType(this.coordinateType);
		dto.setStandByPhone(this.standByPhone);
		dto.setServiceStartTime(this.serviceStartTime);
		dto.setServiceEndTime(this.serviceEndTime);
		dto.setDeliveryRangeRadius(this.deliveryRangeRadius);
		dto.setCoordinatePoints(this.coordinatePoints);
		dto.setBelong(this.belong);
		dto.setRemark(this.remark);
		dto.setCreateUserId(this.createUserId);
		dto.setCreateUserName(this.createUserName);
		dto.setCreateTime(this.createTime);
		dto.setOrgId(this.orgId);
		dto.setOrgCode(this.orgCode);
		dto.setNodeCode(this.nodeCode);
		return dto;
	}

	public String getOfflineCode() {
		return offlineCode;
	}

	public void setOfflineCode(String offlineCode) {
		this.offlineCode = offlineCode;
	}

	public String getOnlineCode() {
		return onlineCode;
	}

	public void setOnlineCode(String onlineCode) {
		this.onlineCode = onlineCode;
	}

	public String getOnlineName() {
		return onlineName;
	}

	public void setOnlineName(String onlineName) {
		this.onlineName = onlineName;
	}

	public String getStauts() {
		return stauts;
	}

	public void setStauts(String stauts) {
		this.stauts = stauts;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getAddressDetail() {
		return addressDetail;
	}

	public void setAddressDetail(String addressDetail) {
		this.addressDetail = addressDetail;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	public String getLng() {
		return lng;
	}

	public void setLng(String lng) {
		this.lng = lng;
	}

	public String getDeliveryRangeType() {
		return deliveryRangeType;
	}

	public void setDeliveryRangeType(String deliveryRangeType) {
		this.deliveryRangeType = deliveryRangeType;
	}

	public String getCoordinateType() {
		return coordinateType;
	}

	public void setCoordinateType(String coordinateType) {
		this.coordinateType = coordinateType;
	}

	public String getStandByPhone() {
		return standByPhone;
	}

	public void setStandByPhone(String standByPhone) {
		this.standByPhone = standByPhone;
	}

	public String getServiceStartTime() {
		return serviceStartTime;
	}

	public void setServiceStartTime(String serviceStartTime) {
		this.serviceStartTime = serviceStartTime;
	}

	public String getServiceEndTime() {
		return serviceEndTime;
	}

	public void setServiceEndTime(String serviceEndTime) {
		this.serviceEndTime = serviceEndTime;
	}

	public String getDeliveryRangeRadius() {
		return deliveryRangeRadius;
	}

	public void setDeliveryRangeRadius(String deliveryRangeRadius) {
		this.deliveryRangeRadius = deliveryRangeRadius;
	}

	public String getCoordinatePoints() {
		return coordinatePoints;
	}

	public void setCoordinatePoints(String coordinatePoints) {
		this.coordinatePoints = coordinatePoints;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getNodeCode() {
		return nodeCode;
	}

	public void setNodeCode(String nodeCode) {
		this.nodeCode = nodeCode;
	}
}
